package com.spzx.user.api;


import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.api.factory.RemoteUserFallbackFactory;
import com.spzx.user.domain.UserAddress;
import com.spzx.user.domain.UserInfo;
import com.spzx.user.domain.UserRegisterDTO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = ServiceNameConstants.USER_SERVICE,
                fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {
    @Operation(summary = "内部调用接口：注册保存会员数据")
    @PostMapping("/userInfo/saveUserInfo")
    public R saveUserInfo(@RequestBody UserRegisterDTO userRegisterDTO);


    @Operation(summary = "内部调用接口：登录根据账号查询会员数据")
//    //com.spzx.common.core.domain.R<com.spzx.user.api.domain.UserInfo>
    @PostMapping("userInfo/getUserInfo")
    public R<UserInfo> getUserInfo(@RequestParam("username") String username);

    @Operation(summary = "内部调用接口：根据id获取用户地址详细信息")
    @GetMapping(value = "userAddress/getById/{id}")
    public R<UserAddress> getUserAddressById(@PathVariable("id") Long id);
}
